package com.longxi.tianjintianbao.ui.activity.patrol;

import android.content.Intent;
import android.support.v7.widget.RecyclerView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.patrol.PatrolScanSearchAtPresenter;
import com.longxi.tianjintianbao.ui.presenter.task.TaskListAtPresenter;
import com.longxi.tianjintianbao.ui.view.patrol.IPatrolScanSearchAtView;
import com.longxi.tianjintianbao.ui.view.task.ITaskListAtView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;

public class PatrolScanSearchActivity extends BaseActivity<IPatrolScanSearchAtView, PatrolScanSearchAtPresenter> implements IPatrolScanSearchAtView {

    private final String TAG = "PatrolScanSearchActivity";

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_general_list;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
        mPresenter.initAdapter("0");

    }

    @Override
    public void initListener() {
        super.initListener();
        mPresenter.getScanSearchList();
    }

    @Override
    protected PatrolScanSearchAtPresenter createPresenter() {
        return new PatrolScanSearchAtPresenter(this);
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mRefreshLayout;
    }

    @Override
    public RecyclerView getRvContent() {
        return mRvContent;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(RESULT_OK != resultCode){
            return;
        }
        setResult(RESULT_OK);
        mPresenter.getScanSearchList();
        mPresenter.sendBroadcast();
        finish();
    }
}
